package com.art8173.day7.question_2;

public class Rectangle {
    private int length;
    private int width;

    public void area() {
        //长为: 8, 宽为: 6 的矩形的面积为: 48
        System.out.println("长为: " + length + ", 宽为: " + width + " 的矩形的面积为: " + length * width);
    }

    public void size() {
        //长为: 8, 宽为: 6 的矩形的周长为: 28
        System.out.println("长为: " + length + ", 宽为: " + width + " 的矩形的周长为: " + (length + width) * 2);
    }

    public Rectangle() {
    }

    public Rectangle(int length, int width) {
        this.length = length;
        this.width = width;
    }

    public int getLength() {
        return length;
    }

    public void setLength(int length) {
        this.length = length;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }
}
